<html>
<head>
    @include('v1.common.meta')
    <link rel="stylesheet" href="{{elixir('css/basicdata.css')}}">
    <link rel="stylesheet" href="{{elixir('css/collect_data.css')}}">
    <link rel="stylesheet" href="{{elixir('css/circuit_detail.css')}}">
</head>
<body>
<div class="yjs-grid">
    <div class="yjs-grid-box">
        <div class="layui-tab">
            @if(Auth::check())
                <div class="layui-container">
                    <!-- 基础信息区 -->
                    <div class="layui-row">
                        <div class="layui-col-md12">
                            <fieldset class="layui-elem-field">
                                <legend>{{$itemData['name']}}基础信息</legend>
                                <div class="layui-field-box">
                                    <div class="layui-form layui-form-pane" name="circuitForm"
                                         action="javascript:;" method="POST">
                                        <input type="hidden" name="code" value="{{$itemData['code']}}">
                                        <div class="layui-row">
                                            <div class="layui-col-md6">
                                                <div class="layui-form-item">
                                                    <label class="layui-form-label">名称</label>
                                                    <div class="layui-input-inline">
                                                        <input type="text" value="{{$itemData['name']}}" disabled
                                                               class="layui-input">
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="layui-col-md6">
                                                <div class="layui-form-item">
                                                    <label class="layui-form-label">变压器编号</label>
                                                    <div class="layui-input-inline">
                                                        <input type="text" value="{{$device_code}}" disabled
                                                               class="layui-input">
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="layui-row">
                                            <div class="layui-col-md6">
                                                <div class="layui-form-item">
                                                    <label class="layui-form-label">变压器地址</label>
                                                    <div class="layui-input-inline">
                                                        <input type="text" value="{{$device_address}}" disabled
                                                               class="layui-input">
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="layui-col-md6">
                                                <div class="layui-form-item">
                                                    <label class="layui-form-label">采集器编号</label>
                                                    <div class="layui-input-inline">
                                                        <input type="text" value="{{$itemData['collector_code']}}" disabled
                                                               class="layui-input">
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="layui-row">
                                            <div class="layui-col-md6">
                                                <div class="layui-form-item">
                                                    <label class="layui-form-label">温度</label>
                                                    <div class="layui-input-inline">
                                                        <input type="text" value="{{$itemData['temperature']}}℃" disabled
                                                               class="layui-input">
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="layui-col-md6">
                                                <div class="layui-form-item">
                                                    <label class="layui-form-label">电压</label>
                                                    <div class="layui-input-inline">
                                                        <input type="text" value="{{$itemData['voltage']}}V" disabled
                                                               class="layui-input">
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="layui-row">
                                            <div class="layui-col-md6">
                                                <div class="layui-form-item">
                                                    <label class="layui-form-label">电流</label>
                                                    <div class="layui-input-inline">
                                                        <input type="text" value="{{$itemData['electric']}}A" disabled
                                                               class="layui-input">
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="layui-col-md6">
                                                <div class="layui-form-item">
                                                    <label class="layui-form-label">采集状态</label>
                                                    <div class="layui-input-inline">
                                                        <input type="text" value="{{$itemData['state']}}" disabled
                                                               class="layui-input">
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                        {{--<div class="layui-row">--}}
                                            {{--<div class="layui-col-md6">--}}
                                                {{--<div class="layui-form-item">--}}
                                                    {{--<label class="layui-form-label">处理状态</label>--}}
                                                    {{--<div class="layui-input-inline">--}}
                                                        {{--<input type="text" value="{{$itemData['process_state']}}" disabled--}}
                                                               {{--class="layui-input">--}}
                                                        {{--@if($itemData['process_state'])--}}
                                                            {{--<input type="checkbox" name="process_state" value="1"--}}
                                                                   {{--checked--}}
                                                                   {{--lay-skin="switch" lay-text="已处理|未处理">--}}
                                                        {{--@else--}}
                                                            {{--<input type="checkbox" name="process_state" value="1"--}}
                                                                   {{--lay-skin="switch" lay-text="已处理|未处理">--}}
                                                        {{--@endif--}}
                                                    {{--</div>--}}
                                                {{--</div>--}}
                                            {{--</div>--}}
                                        {{--</div>--}}
                                        <div class="layui-row">
                                            <div class="layui-col-md3">
                                                {{--隐藏提交--}}
                                                <button id="toolbarSubmit" type="submit" class="layui-btn"
                                                        lay-filter="toolbarEvent" lay-submit style="display: none;">
                                                </button>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </fieldset>
                        </div>
                    </div>
                    <br>
                    @if($isOnlyAlarm == 'true')
                        <!--  回路24小时变化折线图显示区 -->
                        <fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
                            <legend>回路24小时变化折线图</legend>
                        </fieldset>
                        <div class="layui-row">
                            <div id="circuitChart" style="width: 100%;height:400px;"></div>
                        </div>
                        <br>
                        <!--  回路所有报警数据列表显示区 -->
                        <fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
                            <legend> 回路的历史报警数据</legend>
                        </fieldset>
                        <div class="layui-row" style="margin-top: -10px">
                            <div class="layui-col-md12">
                                <table class="layui-table" id="dataBody" lay-filter="collectDataList">
                                </table>
                            </div>
                        </div>
                    @else
                        <!--  回路所有采集数据列表显示区 -->
                        <fieldset class="layui-elem-field layui-field-title" style="margin-top: -10px;">
                            <legend> 回路的历史采集数据</legend>
                        </fieldset>
                        <div class="layui-row" >
                            <div class="layui-col-md12">
                                <table class="layui-table" id="dataBody" lay-filter="collectDataList">
                                </table>
                            </div>
                        </div>
                    @endif
                </div>
            @else
                <div class="layui-container">
                    <div class="layui-row">
                        <div class="layui-col-md12">
                            <blockquote class="layui-elem-quote-error">
                                友情提示：该功能只面向已成功登录系统，并具有相应权限的用户可用。
                            </blockquote>
                        </div>
                    </div>
                </div>
            @endif
        </div>
    </div>
</div>

@include('v1.common.js')

<script type="text/html" id="groupBtn">
    <div class="layui-btn-group">
        <a class="layui-btn layui-btn-mini" lay-event="editData"><i class="yjs-icon">&#xe61d;</i> 编辑</a>
        <a class="layui-btn layui-btn-mini layui-btn-danger" lay-event="deleteData"><i class="yjs-icon">&#xe61b;</i> 删除</a>
    </div>
</script>
<script src="{{elixir('js/echarts.js')}}"></script>
<script src="{{elixir('js/circuit_detail.js')}}"></script>
</body>
</html>